package edu.sctu.practice.class02.liqiqi.assgin04;

import javax.swing.*;
import java.util.Calendar;

/**
 * Created by uw on 2015/12/3.
 */
public class Deposit {
    public static void main(String[] args) {
        String str= JOptionPane.showInputDialog("输入存款的年份");
        int yearone=Integer.parseInt(str);
        str=JOptionPane.showInputDialog("输入存款的月份");
        int monthone=Integer.parseInt(str);
        str=JOptionPane.showInputDialog("输入存款的日期");
        int dayone=Integer.parseInt(str);
        str= JOptionPane.showInputDialog("输入今天的年份");
        int yeartwo=Integer.parseInt(str);
        str=JOptionPane.showInputDialog("输入今天的月份");
        int monthtwo=Integer.parseInt(str);
        str=JOptionPane.showInputDialog("输入今天的日期");
        int daytwo=Integer.parseInt(str);
        str=JOptionPane.showInputDialog("输入存款的数额");
        long monney=Integer.parseInt(str);
        str=JOptionPane.showInputDialog("输入一天存款的利率");
        long lixi=Integer.parseInt(str);
        Calendar calendar=Calendar.getInstance();
        calendar.set(yearone,monthone,dayone);
        long timeone=calendar.getTimeInMillis();
        calendar.set(yeartwo,monthtwo,daytwo);
        long timetwo=calendar.getTimeInMillis();
        long days=(Math.abs(timetwo-timeone))/(1000*60*60*24);
        long all=lixi*days*monney;
        System.out.println(all);
    }
}
